
************************************
/*	Title: 101 analysis stage one analysis code */
/*	Authors: Jason Rantanen & Nick Datzov */
/*	Date originally created: 1/25/2023 */
************************************

//ssc install asdoc // This will install the asdoc package, which allows for nice tables to be output into Word. 


************************************
/*	Format the Data */
************************************



************************************
/*	Affirmance and Outcome Rates	*/
************************************

// How Often Does the Fed. Cir. Affirm/Reverse the Original Tribunal (by Year)?
asdoc tab year PSM_Disposition_CAFC, save(tables2.doc) title(How Often Does the Fed. Cir. Affirm/Reverse the Original Tribunal (by Year)?) append

// How Often Does the Fed. Cir. Affirm/Reverse the Original Tribunal (by Tribunal)?
asdoc tab PSM_Disposition_CAFC origin, save(tables2.doc) title(How Often Does the Fed. Cir. Affirm/Reverse the Original Tribunal (by Tribunal)?) append

// Is the Fed. Cir. Affirming Original Tribunal Decisions At Same for Affirm/Reverse?
asdoc tab PSM_Outcome_OrigTrib PSM_Disposition_CAFC, save(tables2.doc) title(Is the Fed. Cir. Affirming Original Tribunal Decisions At Same for Affirm/Reverse?) append  

// How Often Does the Fed. Cir. Affirm/Reverse the Original Tribunal (by Year) when district court found patent valid?
asdoc tab year PSM_Disposition_CAFC if PSM_Outcome_OrigTrib==1, save(tables2.doc) title(How Often Does the Fed. Cir. Affirm/Reverse the Original Tribunal (by Year) When Patent Found Valid?) append

// How Often Does the Fed. Cir. Affirm/Reverse the Original Tribunal (by Year) when lower tribunal found patent invalid?
asdoc tab year PSM_Disposition_CAFC if PSM_Outcome_OrigTrib==2, save(tables2.doc) title(How Often Does the Fed. Cir. Affirm/Reverse the Original Tribunal (by Year) When Patent Found Invalid?) append

// How Often Does the Fed. Cir. Affirm/Reverse Based on Exception Type
asdoc tab PSM_101_exception PSM_Disposition_CAFC, save(tables2.doc) title(How Often Does the Fed. Cir. Affirm/Reverse Based on Exception Type?) append



************************************
/*	Validity Rates	*/
************************************

// How Many 101 Fed. Cir. Decisions Found Patent Valid (by Year)?
asdoc tab year PSM_Outcome_CAFC, save(tables2.doc) title(How many 101 Fed. Cir. Decisions Found Patent Valid (by Year)?) append

// How Many 101 Lower Tribunal Decisions Found Patent Valid (by Year)?
asdoc tab year PSM_Outcome_OrigTrib, save(tables2.doc) title(How many Lower Tribunal Decisions Found Patent Valid (by Year)?) append

// How Many 101 District Court Decisions Found Patent Valid (by Year)?
asdoc tab year PSM_Outcome_OrigTrib if origin=="DCT", save(tables2.doc) title(How many District Court Decisions Found Patent Valid (by Year)?) append

// Validity Rates By Year for District Court Decisions)
asdoc tab year PSM_Outcome_CAFC if origin=="DCT", save(tables2.doc) title(Validity Rates By Year for District Court Decisions?) append

// Validity Rates By Year for PTO Decisions)
asdoc tab year PSM_Outcome_CAFC if origin=="PTO", save(tables2.doc) title(Validity Rates By Year for District Court Decisions?) append


************************************
/*	Separate Opinion Rates	*/
************************************
//How often individual judges were not in majority

//NOTE: For 27408, there was no outcome from the Federal Circuit on whether the claims were eligible or ineligible. The Fed. Cir. simply vacated the decision. So, there will be three more "counts" of majority votes than there are votes for the combined valid/invalid votes. Judge Taranto's separate opinion is coded as "Multiple" to indicate there is a separate opinion, but he agreed with the majority.

//NOTE: For 12730, Judge Bryson wrote a separate opinion that is coded as "multiple." Even though the majority's outcome was "multiple," he dissented, so that is a dissenting opinion even though the outcomes matched. 

//***note that tabm does not accurately calculate when one judge voted entirely one way.  Need to manually recheck because the outcome numbers appeared flipped
asdoc tabm Bryson_majority Chen_majority Clevenger_majority Cunningham_majority Dyk_majority Gajarsa_majority Hughes_majority Linn_majority Lourie_majority Mayer_majority Moore_majority Newman_majority OMalley_majority Prost_majority Rader_majority Reyna_majority Schall_majority Stark_majority Stoll_majority Taranto_majority Wallach_majority Plager_majority, save(tables2.doc) title(Judge Separate Opinion Writing) append

//How often individual judges' votes matched CAFC outcome
asdoc tab Bryson_101_vote if PSM_Outcome_CAFC== Bryson_101_vote, save(tables2.doc) append
asdoc tab Bryson_101_vote if PSM_Outcome_CAFC!= Bryson_101_vote, save(tables2.doc) append

asdoc tab Chen_101_vote if PSM_Outcome_CAFC== Chen_101_vote, save(tables2.doc) append
asdoc tab Chen_101_vote if PSM_Outcome_CAFC!= Chen_101_vote, save(tables2.doc) append

asdoc tab Clevenger_101_vote if PSM_Outcome_CAFC== Clevenger_101_vote, save(tables2.doc) append
asdoc tab Clevenger_101_vote if PSM_Outcome_CAFC!= Clevenger_101_vote, save(tables2.doc) append

asdoc tab Cunningham_101_vote if PSM_Outcome_CAFC== Cunningham_101_vote, save(tables2.doc) append
asdoc tab Cunningham_101_vote if PSM_Outcome_CAFC!= Cunningham_101_vote, save(tables2.doc) append

asdoc tab Dyk_101_vote if PSM_Outcome_CAFC== Dyk_101_vote, save(tables2.doc) append
asdoc tab Dyk_101_vote if PSM_Outcome_CAFC!= Dyk_101_vote, save(tables2.doc) append

asdoc tab Hughes_101_vote if PSM_Outcome_CAFC== Hughes_101_vote, save(tables2.doc) append
asdoc tab Hughes_101_vote if PSM_Outcome_CAFC!= Hughes_101_vote, save(tables2.doc) append

asdoc tab Linn_101_vote if PSM_Outcome_CAFC== Linn_101_vote, save(tables2.doc) append
asdoc tab Linn_101_vote if PSM_Outcome_CAFC!= Linn_101_vote, save(tables2.doc) append

asdoc tab Lourie_101_vote if PSM_Outcome_CAFC== Lourie_101_vote, save(tables2.doc) append
asdoc tab Lourie_101_vote if PSM_Outcome_CAFC!= Lourie_101_vote, save(tables2.doc) append

asdoc tab Mayer_101_vote if PSM_Outcome_CAFC== Mayer_101_vote, save(tables2.doc) append
asdoc tab Mayer_101_vote if PSM_Outcome_CAFC!= Mayer_101_vote, save(tables2.doc) append

asdoc tab Moore_101_vote if PSM_Outcome_CAFC== Moore_101_vote, save(tables2.doc) append
asdoc tab Moore_101_vote if PSM_Outcome_CAFC!= Moore_101_vote, save(tables2.doc) append

asdoc tab Newman_101_vote if PSM_Outcome_CAFC== Newman_101_vote, save(tables2.doc) append
asdoc tab Newman_101_vote if PSM_Outcome_CAFC!= Newman_101_vote, save(tables2.doc) append

asdoc tab OMalley_101_vote if PSM_Outcome_CAFC== OMalley_101_vote, save(tables2.doc) append
asdoc tab OMalley_101_vote if PSM_Outcome_CAFC!= OMalley_101_vote, save(tables2.doc) append

asdoc tab Prost_101_vote if PSM_Outcome_CAFC== Prost_101_vote, save(tables2.doc) append
asdoc tab Prost_101_vote if PSM_Outcome_CAFC!= Prost_101_vote, save(tables2.doc) append

asdoc tab Rader_101_vote if PSM_Outcome_CAFC== Rader_101_vote, save(tables2.doc) append
asdoc tab Rader_101_vote if PSM_Outcome_CAFC!= Rader_101_vote, save(tables2.doc) append

asdoc tab Reyna_101_vote if PSM_Outcome_CAFC== Reyna_101_vote, save(tables2.doc) append
asdoc tab Reyna_101_vote if PSM_Outcome_CAFC!= Reyna_101_vote, save(tables2.doc) append

asdoc tab Schall_101_vote if PSM_Outcome_CAFC== Schall_101_vote, save(tables2.doc) append
asdoc tab Schall_101_vote if PSM_Outcome_CAFC!= Schall_101_vote, save(tables2.doc) append

asdoc tab Stark_101_vote if PSM_Outcome_CAFC== Stark_101_vote, save(tables2.doc) append
asdoc tab Stark_101_vote if PSM_Outcome_CAFC!= Stark_101_vote, save(tables2.doc) append

asdoc tab Stoll_101_vote if PSM_Outcome_CAFC== Stoll_101_vote, save(tables2.doc) append
asdoc tab Stoll_101_vote if PSM_Outcome_CAFC!= Stoll_101_vote, save(tables2.doc) append

asdoc tab Taranto_101_vote if PSM_Outcome_CAFC== Taranto_101_vote, save(tables2.doc) append
asdoc tab Taranto_101_vote if PSM_Outcome_CAFC!= Taranto_101_vote, save(tables2.doc) append

asdoc tab Wallach_101_vote if PSM_Outcome_CAFC== Wallach_101_vote, save(tables2.doc) append
asdoc tab Wallach_101_vote if PSM_Outcome_CAFC!= Wallach_101_vote, save(tables2.doc) append

asdoc tab Plager_101_vote if PSM_Outcome_CAFC== Plager_101_vote, save(tables2.doc) append
asdoc tab Plager_101_vote if PSM_Outcome_CAFC!= Plager_101_vote, save(tables2.doc) append


//totals for dissents (if PSM_SecondOpinions and PSM_ThirdOpinions do not match PSM_Outcome_CAFC)
tab year PSM_ThirdOpinion if PSM_Outcome_CAFC!=PSM_ThirdOpinion & !missing(PSM_ThirdOpinion)
tab year PSM_SecondOpinion if PSM_Outcome_CAFC!=PSM_SecondOpinion & !missing(PSM_SecondOpinion)

//totals for seperate opinions (including concurrences)
tab year PSM_SecondOpinion if !missing(PSM_SecondOpinion)
tab year PSM_ThirdOpinion if !missing(PSM_ThirdOpinion)

//How often individual judges' votes matched Lower Tribunal outcome (i.e., affirmed or reversed)
//NOTE: Judge Newman and O'Malley will be one vote short based on 27408 because they didn't cast a vote there.
asdoc tab Bryson_101_vote if Bryson_101_vote== PSM_Outcome_OrigTrib, save(tables2.doc) append
asdoc tab Bryson_101_vote if Bryson_101_vote !=. & PSM_Outcome_OrigTrib != Bryson_101_vote, save(tables2.doc) append

asdoc tab Chen_101_vote if Chen_101_vote== PSM_Outcome_OrigTrib, save(tables2.doc) append
asdoc tab Chen_101_vote if Chen_101_vote !=. & PSM_Outcome_OrigTrib != Chen_101_vote, save(tables2.doc) append

asdoc tab Clevenger_101_vote if Clevenger_101_vote== PSM_Outcome_OrigTrib, save(tables2.doc) append
asdoc tab Clevenger_101_vote if Clevenger_101_vote !=. & PSM_Outcome_OrigTrib != Clevenger_101_vote, save(tables2.doc) append

asdoc tab Cunningham_101_vote if Cunningham_101_vote== PSM_Outcome_OrigTrib, save(tables2.doc) append
asdoc tab Cunningham_101_vote if Cunningham_101_vote !=. & PSM_Outcome_OrigTrib != Cunningham_101_vote, save(tables2.doc) append

asdoc tab Dyk_101_vote if Dyk_101_vote== PSM_Outcome_OrigTrib, save(tables2.doc) append
asdoc tab Dyk_101_vote if Dyk_101_vote !=. & PSM_Outcome_OrigTrib != Dyk_101_vote, save(tables2.doc) append

asdoc tab Hughes_101_vote if Hughes_101_vote== PSM_Outcome_OrigTrib, save(tables2.doc) append
asdoc tab Hughes_101_vote if Hughes_101_vote !=. & PSM_Outcome_OrigTrib != Hughes_101_vote, save(tables2.doc) append

asdoc tab Linn_101_vote if Linn_101_vote== PSM_Outcome_OrigTrib, save(tables2.doc) append
asdoc tab Linn_101_vote if Linn_101_vote !=. & PSM_Outcome_OrigTrib != Linn_101_vote, save(tables2.doc) append

asdoc tab Lourie_101_vote if Lourie_101_vote== PSM_Outcome_OrigTrib, save(tables2.doc) append
asdoc tab Lourie_101_vote if Lourie_101_vote !=. & PSM_Outcome_OrigTrib != Lourie_101_vote, save(tables2.doc) append

asdoc tab Mayer_101_vote if Mayer_101_vote== PSM_Outcome_OrigTrib, save(tables2.doc) append
asdoc tab Mayer_101_vote if Mayer_101_vote !=. & PSM_Outcome_OrigTrib != Mayer_101_vote, save(tables2.doc) append

asdoc tab Moore_101_vote if Moore_101_vote== PSM_Outcome_OrigTrib, save(tables2.doc) append
asdoc tab Moore_101_vote if Moore_101_vote !=. & PSM_Outcome_OrigTrib != Moore_101_vote, save(tables2.doc) append

asdoc tab Newman_101_vote if Newman_101_vote== PSM_Outcome_OrigTrib, save(tables2.doc) append
asdoc tab Newman_101_vote if Newman_101_vote !=. & PSM_Outcome_OrigTrib != Newman_101_vote, save(tables2.doc) append

asdoc tab OMalley_101_vote if OMalley_101_vote== PSM_Outcome_OrigTrib, save(tables2.doc) append
asdoc tab OMalley_101_vote if OMalley_101_vote !=. & PSM_Outcome_OrigTrib != OMalley_101_vote, save(tables2.doc) append

asdoc tab Prost_101_vote if Prost_101_vote== PSM_Outcome_OrigTrib, save(tables2.doc) append
asdoc tab Prost_101_vote if Prost_101_vote !=. & PSM_Outcome_OrigTrib != Prost_101_vote, save(tables2.doc) append

asdoc tab Rader_101_vote if Rader_101_vote== PSM_Outcome_OrigTrib, save(tables2.doc) append
asdoc tab Rader_101_vote if Rader_101_vote !=. & PSM_Outcome_OrigTrib != Rader_101_vote, save(tables2.doc) append

asdoc tab Reyna_101_vote if Reyna_101_vote== PSM_Outcome_OrigTrib, save(tables2.doc) append
asdoc tab Reyna_101_vote if Reyna_101_vote !=. & PSM_Outcome_OrigTrib != Reyna_101_vote, save(tables2.doc) append

asdoc tab Schall_101_vote if Schall_101_vote== PSM_Outcome_OrigTrib, save(tables2.doc) append
asdoc tab Schall_101_vote if Schall_101_vote !=. & PSM_Outcome_OrigTrib != Schall_101_vote, save(tables2.doc) append

asdoc tab Stark_101_vote if Stark_101_vote== PSM_Outcome_OrigTrib, save(tables2.doc) append
asdoc tab Stark_101_vote if Stark_101_vote !=. & PSM_Outcome_OrigTrib != Stark_101_vote, save(tables2.doc) append

asdoc tab Stoll_101_vote if Stoll_101_vote== PSM_Outcome_OrigTrib, save(tables2.doc) append
asdoc tab Stoll_101_vote if Stoll_101_vote !=. & PSM_Outcome_OrigTrib != Stoll_101_vote, save(tables2.doc) append

asdoc tab Taranto_101_vote if Taranto_101_vote== PSM_Outcome_OrigTrib, save(tables2.doc) append
asdoc tab Taranto_101_vote if Taranto_101_vote !=. & PSM_Outcome_OrigTrib != Taranto_101_vote, save(tables2.doc) append

asdoc tab Wallach_101_vote if Wallach_101_vote== PSM_Outcome_OrigTrib, save(tables2.doc) append
asdoc tab Wallach_101_vote if Wallach_101_vote !=. & PSM_Outcome_OrigTrib != Wallach_101_vote, save(tables2.doc) append

asdoc tab Plager_101_vote if Plager_101_vote== PSM_Outcome_OrigTrib, save(tables2.doc) append
asdoc tab Plager_101_vote if Plager_101_vote !=. & PSM_Outcome_OrigTrib != Plager_101_vote, save(tables2.doc) append


************************************
/*	Individual Judge 101 Votes	*/
************************************

//How did individual judges vote on 101 cases
//***note that tabm does not accurately calculate when one judge voted entirely one way.  Need to manually recheck
//NOTE: Judge Newman and O'Malley will be one vote short based on 27408 because they didn't cast a vote there.
asdoc tabm Bryson_101_vote Chen_101_vote Clevenger_101_vote Cunningham_101_vote Dyk_101_vote Hughes_101_vote Linn_101_vote Lourie_101_vote Mayer_101_vote Moore_101_vote Newman_101_vote OMalley_101_vote Prost_101_vote Rader_101_vote Reyna_101_vote Schall_101_vote Stark_101_vote Stoll_101_vote Taranto_101_vote Wallach_101_vote Plager_101_vote, save(tables2.doc) title(Judge 101 Votes) append


************************************
/*	Decision Type	*/
************************************

// How Many Fed. Cir. 101 decisions are Rule 36 Opinions?
asdoc tab docType, save(tables2.doc) title(How many Fed. Cir. 101 decisions are Rule 36 Opinions?) append

// How often did Fed. Cir. use Rule 36 prior to June 20, 2017 (final date of Paul and Mark's dataset)?
//NOTE: this command works in Stata command line prompt but not in .do file
//asdoc tab docType if docDate < date("06/20/2017","MDY"), save(tables2.doc) title(Rule 36 prior to June 20, 2017) append

//How often did Fed. Cir. use Rule 36 after June 19, 2017 (final date of Paul and Mark's dataset)?
//NOTE: this command works in Stata command line prompt but not in .do file
//asdoc tab docType if docDate > date("06/19/2017","MDY"), save(tables2.doc) title(Rule 36 after to June 19, 2017) append

//How often did Fed. Cir. use Rule 36 between June 19, 2014 and June 19, 2017 (dates of Paul and Mark's dataset)?
//NOTE: this command works in Stata command line prompt but not in .do file
//asdoc tab docType if docDate < date("06/19/2017","MDY") & docDate > date("06/19/2014","MDY"), save(tables2.doc) title(Rule 36 after to June 19, 2017) append

// How Many Fed. Cir. 101 decisions are Rule 36 Opinions (by Year)?
asdoc tab year docType, save(tables2.doc) title(How many Fed. Cir. 101 decisions are Rule 36 Opinions (by Year)?) append
//asdoc graph bar (count), over (docType), save(tables2.doc) title(How Many Fed. Cir. 101 decisions are Rule 36 Opinions?) append

// How Many 101 Fed. Cir. Decisions are Precedential (by Year)?
asdoc tab year PrecedentialStatus, save(tables2.doc) title(How Many 101 Fed. Cir. Decisions are Precedential (by Year)?) append

//How Many 101 Fed. Cir. Decisions are Precedential?
asdoc tab PrecedentialStatus, save(tables2.doc) title(How Many 101 Fed. Cir. Decisions are Precedential?) append

// How Often Does Fed. Cir. Use Rule 36 Opinions for Valid/Invalid Patents?
asdoc tab PSM_Outcome_CAFC docType, save(tables2.doc) title(How Often Does Fed. Cir. Use Precedential Opinions for Valid/Invalid Patents?) append

// How Often Does Fed. Cir. Use Precedential Opinions for Valid/Invalid Patents?
asdoc tab PSM_Outcome_CAFC PrecedentialStatus, save(tables2.doc) title(How Often Does Fed. Cir. Use Precedential Opinions for Valid/Invalid Patents?) append

//How Often Does Fed. Cir. Find Patents Valid in Nonprecedential (non-Rule 36) opinions?
asdoc tab PSM_Outcome_CAFC if PrecedentialStatus=="Nonprecedential" & docType!="Rule 36", save(tables2.doc) title(How Often Does Fed. Cir. Find Patents Valid in Nonprecedential (non-Rule 36) opinions?) append


// How Many Rule 36 Opinions Relate to Valid Patents?
asdoc  tab PSM_Outcome_CAFC docType, save(tables2.doc) title(How Many Rule 36 Opinions Relate to Valid Patents?) append

// How Many Rule 36 Opinions Relate to Valid Patents prior to June 20, 2017 (final date of Paul and Mark's dataset)?
//NOTE: this command works in Stata command line prompt but not in .do file
//asdoc  tab PSM_Outcome_CAFC docType if docDate < date("06/20/2017","MDY"), save(tables2.doc) title(Rule 36 Finding Valid Patents prior to June 20, 2017?) append

// How Many Rule 36 Opinions Relate to Valid Patents after June 19, 2017 (final date of Paul and Mark's dataset)?
//NOTE: this command works in Stata command line prompt but not in .do file
//asdoc  tab PSM_Outcome_CAFC docType if docDate > date("06/19/2017","MDY"), save(tables2.doc) title(Rule 36 Finding Valid Patents prior to June 20, 2017?) append



************************************
/*	Exception Type	Data */
************************************

//Invalidity Rates Based on 101 Exception
asdoc tab PSM_101_exception PSM_Outcome_CAFC, save(tables2.doc) title(Invalidity Rates Based on 101 Exception) append

//Cases with Seperate Opinions based on exception type
asdoc tab PSM_101_exception PSM_SecondOpinion if PSM_SecondOpinion != ., save(tables2.doc) title(Cases with Seperate Opinions By Exception Type) append

//Cases with Third Opinions based on exception type
asdoc tab PSM_101_exception PSM_ThirdOpinion if PSM_ThirdOpinion != ., save(tables2.doc) title(Cases with Seperate Opinions By Exception Type) append


************************************
/*	General Findings	*/
************************************

// Where Do Fed. Cir. 101 Appeals Come From (by Year)?
asdoc tab year origin, save(tables2.doc) title(Where Do Fed. Cir. 101 Appeals Come From (by Year)?) replace
//asdoc graph bar (count), over (origin), save(tables2.doc) title(Where Do Fed. Cir. 101 Appeals Come From?) append

// What is the Procedural Posture for 101 Appeals?
asdoc tab PSM_ProceduralPosture, save(tables2.doc) title(What is the Procedural Posture for 101 Appeals?) append
//asdoc tab PSM_ProceduralPosture year         ***need to fix size of table to fit within page

// What is the Procedural Posture for 101 Appeals (by Year)
asdoc tab year PSM_ProceduralPosture, save(tables2.doc) title(What is the Procedural Posture for 101 Appeals (by Year)) append

// What is the Procedural Posture for 101 Appeals (by Year) Where Patent Found Invalid by D. Ct.?
asdoc tab year PSM_ProceduralPosture if PSM_Outcome_OrigTrib==2, save(tables2.doc) title(What is the Procedural Posture for 101 Appeals (by Year) Where Patent Found Invalid by D. Ct.?) append

// What Are Validity/Invalidity Outcomes Based on Procedural Posture?
asdoc tab PSM_ProceduralPosture PSM_Outcome_CAFC, save(tables2.doc) title(What Are Validity/Invalidity Outcomes Based on Procedural Posture?) append

// How Has Time Impacted D. Ct. and PTO Invalidity Rates (for appealed decisions)?
asdoc tab year PSM_Outcome_OrigTrib, save(tables2.doc) title(How Has Time Impacted D. Ct. and PTO Invalidity Rates (for appealed decisions)?) append

// How Has Time Impacted D. Ct. Rule 12(b)(6) patent outcomes (for appealed decisions)?
asdoc tab year PSM_Outcome_OrigTrib if PSM_ProceduralPosture==1, save(tables2.doc) title(How Has Time Impacted D. Ct. Rule 12(b)(6) patent outcomes (for appealed decisions)?) append

// How Has Time Impacted D. Ct. Rule 12(c) patent outcomes (for appealed decisions)?
asdoc tab year PSM_Outcome_OrigTrib if PSM_ProceduralPosture==2, save(tables2.doc) title(How Has Time Impacted D. Ct. Rule 12(c) patent outcomes (for appealed decisions)?) append

// How Often Does Fed. Cir. Find Eligibility/Ineligibility Based on Step 1 or 2?
asdoc tab PSM_Stage1_CAFC PSM_Outcome_CAFC, save(tables2.doc) title(How Often Does Fed. Cir. Find Eligibility/Ineligibility Based on Step 1 or 2?) append 
asdoc tab PSM_Stage2_CAFC PSM_Outcome_CAFC, save(tables2.doc) title()append  

//Which District Courts Were Affirmed/Reversed Most Often?
asdoc tab TribOfOrigin PSM_Disposition_CAFC, save(tables2.doc) title(Which District Courts Were Affirmed/Reversed Most Often?) append


************************************
/* This section uses the most recent version of the CAFC Dataset Project Document Dataset to calculate overall dissent rates, not including the decisions in the 101 dataset */
************************************

//cd "~/Dropbox/2022 CAFC Decisionmaking/Data"

use "2023-12-31 CAFC documents Release.dta", clear

merge 1:1 uniqueID using "2024-11-20 101 cases.dta"
drop if PSM_decided == 2


************************************
/*	Dissent Rates for All Fed. Cir. Cases That Are Not En Banc Decisions	*/
************************************
// Frequency of dissent for all origins, either Opinion or Rule 36
tab docYear Dissent if (docType=="Opinion" | docType=="Rule 36") & Replaced!="Yes" & docYear>2011 & docYear < 2024 & enBanc != "Yes" & enBanc !="Partial"
tab Dissent if (docType=="Opinion" | docType=="Rule 36") & Replaced!="Yes" & docYear>2011 & docYear < 2024 & enBanc != "Yes" & enBanc !="Partial"

// Frequency of dissent for all origins, Opinions only
tab docYear Dissent if (docType=="Opinion") & Replaced!="Yes"  & docYear>2011 & docYear < 2024 & enBanc != "Yes" & enBanc !="Partial"
tab Dissent if (docType=="Opinion") & Replaced!="Yes"  & docYear>2011 & docYear < 2024 & enBanc != "Yes" & enBanc !="Partial"

// Frequency of dissent for DCT only, either Opinion or Rule 36
tab docYear Dissent if (docType=="Opinion" | docType=="Rule 36") & origin=="DCT" & Replaced!="Yes"  & docYear>2011 & docYear < 2024 & enBanc != "Yes" & enBanc !="Partial"
tab Dissent if (docType=="Opinion" | docType=="Rule 36") & origin=="DCT" & Replaced!="Yes"  & docYear>2011 & docYear < 2024 & enBanc != "Yes" & enBanc !="Partial"

// Frequency of dissent for DCT only, Opinions only
tab docYear Dissent if (docType=="Opinion") & origin=="DCT" & Replaced!="Yes"  & docYear>2011 & docYear < 2024 & enBanc != "Yes" & enBanc !="Partial"
tab Dissent if docType=="Opinion" & origin=="DCT" & Replaced!="Yes"  & docYear>2011 & docYear < 2024 & enBanc != "Yes" & enBanc !="Partial"


************************************
/*	Dissent Rates for All Patent Cases That Are Not En Banc Decisions	*/
************************************
// Frequency of dissent for DCT only, either Opinion or Rule 36, patent infringement only
tab docYear Dissent if (docType=="Opinion" | docType=="Rule 36") & origin=="DCT" & Replaced!="Yes"  & docYear>2011 & docYear < 2024 & (DisputeType=="Patent infringement" | DisputeType == "Denial-Patent") & enBanc != "Yes" & enBanc !="Partial"
tab Dissent if (docType=="Opinion" | docType=="Rule 36") & origin=="DCT" & Replaced!="Yes"  & docYear>2011 & docYear < 2024 & (DisputeType=="Patent infringement" | DisputeType == "Denial-Patent") & enBanc != "Yes" & enBanc !="Partial"

// Frequency of dissent for DCT only, Opinions only, patent infringement only
tab docYear Dissent if (docType=="Opinion") & origin=="DCT" & Replaced!="Yes" & docYear>2011 & docYear < 2024 & (DisputeType=="Patent infringement" | DisputeType == "Denial-Patent") & enBanc != "Yes" & enBanc !="Partial"
tab Dissent if (docType=="Opinion") & origin=="DCT" & Replaced!="Yes"  & docYear>2011 & docYear < 2024 & (DisputeType=="Patent infringement" | DisputeType == "Denial-Patent") & enBanc != "Yes" & enBanc !="Partial"

// Frequency of dissent for BPAI or PTAB only, either Opinion or Rule 36
tab docYear Dissent if (docType=="Opinion" | docType=="Rule 36") & Replaced!="Yes"  & docYear>2011 & docYear < 2024 & (TribOfOrigin=="BPAI" | TribOfOrigin=="PTAB") & enBanc != "Yes" & enBanc !="Partial"
tab Dissent if (docType=="Opinion" | docType=="Rule 36") & Replaced!="Yes"  & docYear>2011 & docYear < 2024 & (TribOfOrigin=="BPAI" | TribOfOrigin=="PTAB") & enBanc != "Yes" & enBanc !="Partial"

// Frequency of dissent for BPAI or PTAB only, Opinions only
tab docYear Dissent if (docType=="Opinion") & Replaced!="Yes" & docYear>2011 & docYear < 2024 & (TribOfOrigin=="BPAI" | TribOfOrigin=="PTAB") & enBanc != "Yes" & enBanc !="Partial"
tab Dissent if (docType=="Opinion") & Replaced!="Yes"  & docYear>2011 & docYear < 2024 & (TribOfOrigin=="BPAI" | TribOfOrigin=="PTAB") & enBanc != "Yes" & enBanc !="Partial"

// Frequency of dissent for all patent, either Opinion or Rule 36
tab docYear Dissent if (docType=="Opinion" | docType=="Rule 36") & Replaced!="Yes"  & docYear>2011 & docYear < 2024 & (TribOfOrigin=="BPAI" | TribOfOrigin=="PTAB" | DisputeType=="Patent infringement" | DisputeType == "Denial-Patent") & enBanc != "Yes" & enBanc !="Partial"
tab Dissent if (docType=="Opinion" | docType=="Rule 36") & Replaced!="Yes"  & docYear>2011 & docYear < 2024 & (TribOfOrigin=="BPAI" | TribOfOrigin=="PTAB" | DisputeType=="Patent infringement" | DisputeType == "Denial-Patent") & enBanc != "Yes" & enBanc !="Partial"

// Frequency of dissent for all patent, Opinions only
tab docYear Dissent if (docType=="Opinion") & Replaced!="Yes"  & docYear>2011 & docYear < 2024 & (TribOfOrigin=="BPAI" | TribOfOrigin=="PTAB" | DisputeType=="Patent infringement" | DisputeType == "Denial-Patent") & enBanc != "Yes" & enBanc !="Partial"
tab Dissent if docType=="Opinion" & Replaced!="Yes"  & docYear>2011 & docYear < 2024 & (TribOfOrigin=="BPAI" | TribOfOrigin=="PTAB" | DisputeType=="Patent infringement" | DisputeType == "Denial-Patent") & enBanc != "Yes" & enBanc !="Partial"